#!/usr/bin/perl -ws
$trace = (defined($t) && ($t eq "1"));
#print "p=$p\n";
{
$test1 = <<'EOD'
Test UI String Item getText: [Flash MX For Beginners
],A series of tutorials designed to teach beginners how to use Flash. Getting started, Pre Loaders, Movie Controllers, Volume Controls, Email
Test UI String Item Label: Link:
Test UI String Item text: http://www.webthang.co.uk/rss_feeds/rss5.asp
Test UI String Item appearance: 1
EOD
};
$prev_line = "";
#test foreach $line (split("\n", $test1)) { #undo
#test  $line = "$line\n"; #undo
#test  $trace = 1; #undo
#}
while (defined ($line = <>)) {
    #print "line=$line\n";
	if ($line =~ /^Test UI String Item getText: \[[^\[]*$/) {
		$prev_line = $line;
		if ($trace) {
			print "\$prev_line=$prev_line";
		}
		next;
	} if ($prev_line ne "") {
		if ($line =~ /^\],/) {
			$prev_line =~ s/[\n\r]*//g;
			print "$prev_line$line";
		} else {
			print "$prev_line";
			print "$line";
		}
		$prev_line = "";
	} else {
		print $line;
	}
}
exit 0;
print "$test1\n";
